package com.dog.modules.system.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dog.modules.system.domain.SysUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
* @author liuxk
* @description 针对表【sys_user(用户管理)】的数据库操作Mapper
* @createDate 2024-01-30 14:47:29
* @Entity com.dog.modules.system.domain.entity.SysUser
*/
public interface SysUserMapper extends BaseMapper<SysUser> {

    List<SysUser> getList(Map<String, Object> params);


    SysUser getById(@Param("id") Long id);

    List<SysUser> getRoleUserList(Map<String, Object> params);

    default SysUser getByUsername(String username){
        return this.selectOne(new QueryWrapper<SysUser>().eq("username", username));
    }

    default SysUser getByMobile(String mobile){
        return this.selectOne(new QueryWrapper<SysUser>().eq("mobile", mobile));
    }

}




